Skip to content

feat(fleet-proxy): raw TCP splice for RustDesk direct access (salvage of #7338) - #8618

Merged
dezren39 merged 2 commits into
mainfrom
queue/14926-7297-fleet-proxy-splice
Nov 11, 2026
Merged

dezren39 merged 2 commits into
mainfrom
queue/14926-7297-fleet-proxy-splice

Conversation

@dezren39

@dezren39 dezren39 commented Nov 11, 2026 •

Copy link
Copy Markdown
Member

Salvage re-application of the remainder of closed archive PR #7338 (task 14926, batch issue #7297).

What this adds

  • fleet proxy splice: a loopback listener on 127.0.0.1:21118 that relays each accepted TCP stream through the fleet broker to the laptop's RustDesk direct-access service (new raw_splice.rs / raw_stream.rs in fleet-proxy).
  • Broker side: serve.rs handles a raw_splice session frame, gated on the client advertising the new proxy-raw-splice capability AND the rustdesk service being present in the services map; anything else gets an explicit error frame.
  • fleet-config: PORT_RUSTDESK (21118) added to the default services table (rustdesk, rustdesk-direct-v1), with the services test updated to 4 entries.
  • fleet-registry: new Capability::ProxyRawSplice (proxy-raw-splice), in serve + connect capability sets and the proxy domain's subcommands.

Re-application notes (three-way discipline)

  • The archive tip was based on the pre-Session proxy: fail fast (≤2s, not 16-26s), single-flight recovery, timestamped broker log, pool stays 50 #5758 tunnel design (unbounded TcpStream::connect, timeout-shaped tune). connect_raw_tunnel is re-expressed on current main's deadline design: setup is bounded by TRANSPORT_DEADLINE via connect_tunnel_inner, and only the established raw stream carries no read/write timeouts — the archive's intent, on main's structure.
  • Conflicts with main-side additions since the archive (the fleet proxy ssh recovery subcommand, registry domain text, fleet-config dispatch-test validation) were resolved as unions: both subcommands and both validations survive.

Tests

  • cargo test -p fleet-proxy -p fleet-config -p fleet-registry -p fleet on the laptop: all suites pass (89 fleet-proxy incl. the new raw_direct_tunnel_has_no_http_timeouts and raw_connect_tunnel_clears_timeouts_after_handshake, 45 fleet-config, 19+14 registry/fleet, 0 failures). cargo fmt applied to the touched crates.
  • PR Archive disposition: archive/janitor-2026-11-07/10516 #7338 itself is not reopened and its archive branch is not recreated, per the task scope.

Autofix with [code]smith
Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.

… of PR #7338)

Re-applies the remainder of closed archive PR #7338 (task 14926, issue #7297) onto current main: fleet proxy splice subcommand + raw_splice/raw_stream relay, broker raw_splice session handling gated on the proxy-raw-splice capability and the rustdesk service (port 21118 in the default services table), and connect_raw_tunnel re-expressed on the current deadline-based tunnel design (#5758: setup bounded by TRANSPORT_DEADLINE, established raw stream carries no HTTP timeouts). Conflicts with main-side ssh subcommand and registry/domain updates resolved as unions.
@dezren39
dezren39 requested a review from a team as a code owner November 11, 2026 09:09
@coderabbitai

coderabbitai Bot commented Nov 11, 2026 •

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 37 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: d5e51026-3a67-4205-9ccd-e93b61fd6e19
Commits

Reviewing files that changed from the base of the PR and between 81bbb34 and 7ace7db.

Files selected for processing: 8

  • pkgs/fleet/crates/fleet-config/src/lib.rs
  • pkgs/fleet/crates/fleet-proxy/src/lib.rs
  • pkgs/fleet/crates/fleet-proxy/src/raw_splice.rs
  • pkgs/fleet/crates/fleet-proxy/src/raw_stream.rs
  • pkgs/fleet/crates/fleet-proxy/src/serve.rs
  • pkgs/fleet/crates/fleet-proxy/src/tunnel.rs
  • pkgs/fleet/crates/fleet-registry/src/lib.rs
  • pkgs/fleet/crates/fleet/src/main.rs
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 11, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-11T09:15:47.939642Z 7ace7db New commits
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: c3df615b40

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

… exit

Codex P2 on PR #8618: a raw relay only refreshed broker.last_used at setup, so keepalive_loop would exit the broker after idle_exit_secs (default 3600s) even mid-session. serve_session now refreshes last_used every 60s from a scoped thread for the life of the relay.
@dezren39

Copy link
Copy Markdown
Member Author

Fixed in 7ace7db: serve_session now runs the raw relay inside a std::thread::scope with a companion thread that refreshes broker.last_used every 60 s for the life of the relay (stopping when the relay returns), so an active RustDesk splice counts as broker activity and the idle exit can no longer kill the broker mid-session. Verified: cargo test -p fleet-proxy — 89 passed, 0 failed.

@dezren39
dezren39 merged commit 4045dff into main Nov 11, 2026
1 of 8 checks passed
@dezren39
dezren39 deleted the queue/14926-7297-fleet-proxy-splice branch November 11, 2026 09:16
@dezren39

Copy link
Copy Markdown
Member Author

🤖 Agent note · salvage check for duplicate PR #7703 (task 10516)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant